import { createRouter, createWebHistory } from 'vue-router'
import Login from '../views/Login.vue'
// import Home from '../views/Home.vue'

const routes = [
    {
        path: '/login',
        name: 'Login',
        component: Login
    },
    {
        path: '/home',
        name: 'Home',
        component: () => import('../views/Home.vue'),
        children: [

            {
                path: '/home/user',
                name: 'User',
                component: () => import('../views/User.vue')
            },
            {
                path: '',
                redirect: '/home/user'
            },
        ]
    }
]

const router = createRouter({
    history: createWebHistory(import.meta.env.BASE_URL),
    routes: routes
})

export default router;
